﻿using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Messaging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using ZFSDomain.Common.UserControls;

namespace ZFSDomain.Common.CoreLib
{

    /// <summary>
    /// 加载窗口行为
    /// </summary>
    public class SplashScreenFunc
    {
        /// <summary>  
        /// 显示等待窗体  
        /// </summary>  
        public static void Show(string waitInfo = "正在加载, 请稍候!")
        {
            Messenger.Default.Send(new SplashScreenViewModel(waitInfo), "Show");
        }

        /// <summary>  
        /// 关闭等待窗体  
        /// </summary>  
        public static void Close()
        {
            Messenger.Default.Send("", "Hide");
        }

    }

    /// <summary>
    /// 等待窗口
    /// </summary>
    public class SplashScreenViewModel : ViewModelBase
    {
        public SplashScreenViewModel(object WaitInfo)
        {
            _WaitInfo = WaitInfo;
        }

        private object _WaitInfo;

        /// <summary>
        /// 提示信息
        /// </summary>
        public object WaitInfo
        {
            get { return _WaitInfo; }
        }
    }
}
